<template>
  <div>
    <el-header height="200px">
      <div class="infoShow">
        <infoleft></infoleft>
        <div class="infoRight">
          <div>
            <div class="myCourse">
              <div >我的订单</div>
              <div class="myCourseNum">{{this.$store.state.orders.length}}</div>
            </div>
            <div class="myCourse">
              <div>支出</div>
              <div class="myCourseNum">{{this.pay}}</div>
            </div>
            <div class="myCourse">
              <div>余额</div>
              <div class="myCourseNum">{{this.$store.state.grades.balance}}</div>
            </div>
          </div>
        </div>
      </div>
    </el-header>
  </div>
</template>

<script>
import infoleft from "./studentinfoleft";

export default {
  name: "studentinforightorder",
  components:{
    'infoleft':infoleft,
  },
  data(){
    return{
      orderSuccess:[],
      pay:''
    }
  },
  created() {
    this.orderSuccess = this.$store.state.orderSuccess;
    let count = 0;
    for (let i = 0; i < this.orderSuccess.length; i++) {
      count += this.orderSuccess[i].course.price;
    }
    this.pay = count;
  }
}
</script>

<style scoped>
@import "../../assets/css/student.css";
</style>
